package engine.map;

import java.awt.Color;
import engine.display.Display;

/**
 * This is an individual cell in the game world. Mostly a container for holding data about this
 * space in the world.
 * <p>
 * Tiles are saved as single characters and colors. <br>
 * Tiles do not contain information about where they are located.
 */
public abstract class Tile {

	/**
	 * @return this tile's color
	 */
	public abstract Color getColor();

	/**
	 * @return whether the tile blocks light
	 */
	public abstract boolean isObstruction();

	/**
	 * @return whether the tile can be moved through
	 */
	public abstract boolean isPassable();

	/**
	 * Draws this tile to the display
	 * 
	 * @param display
	 *            the display to render upon
	 * @param x
	 *            the x-coordinate in cells
	 * @param y
	 *            the y-coordinate in cells
	 */
	public abstract void render(Display display, int x, int y);

	/**
	 * Draws this tile to the display, but darker than usual
	 * 
	 * @param display
	 *            the display to render upon
	 * @param x
	 *            the x-coordinate in cells
	 * @param y
	 *            the y-coordinate in cells
	 */
	public abstract void renderShaded(Display display, int x, int y);

	/**
	 * Sets the tile's color
	 * 
	 * @param color
	 *            this tile's color
	 */
	public abstract void setColor(Color color);

	/**
	 * Should return a single character that is unique to this tile. Used in saving/loading.
	 */
	@Override
	public abstract String toString();
}
